package commands;

import clientRequest.ClientRequest;
import controller.ExecutorsManager;
import controller.ExecutorsManager.AddFileExecutor;

/**
 * class AddFileCommand - execute add file command
 */
public class AddFileCommand {
	
	AddFileExecutor addFileExecutor = ExecutorsManager.getInstance().getAddFileExecutor();
	
	/**
	 * constructor
	 */
	public AddFileCommand(){}

	/**
	 * add the user file
	 * @param clientRequest - a client request that contains the file details
	 * @return 1 - if succeed. 0 - if failed.
	 */
	public int action(ClientRequest clientRequest) 
	{
		// TODO Auto-generated method stub
		return addFileExecutor.addRequest(clientRequest.getUserID(), clientRequest.getFileName(),clientRequest.getFilePath(), clientRequest.getByteFile(), clientRequest.getChecksum(), clientRequest.isMyDropBox(), clientRequest.isWebUpload());				
	}

}
